/**
 * 
 */
package com.shop.repositories;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.shop.entities.Category;
import com.shop.mappers.CategoryMapper;

/**
 * 
 *
 */
@Repository
public class CategoryRepository {

	@Autowired
	private CategoryMapper categoryMapper;
	
		
	public Category findCategoryById(Integer id) {
		return categoryMapper.findCategoryById(id);
	}

	public List<Category> findAllCategories() {
		return categoryMapper.findAllCategory(); 
	}
	
	
	public void addCategory(Category c) {
		categoryMapper.add(c); 
	}
	
	public void deleteCategory(Category c) {
		categoryMapper.delete(c); 
	}
	
	public void updateCategory(Category c) {
		categoryMapper.update(c); 
	}
}
